package com.symaster.common.swing.element;

import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import com.symaster.common.swing.config.AppConfig;
import com.symaster.common.swing.style.Style;

import javax.swing.*;
import javax.swing.border.TitledBorder;
import java.awt.*;

/**
 * @author yinmiao
 * @date 2021-12-08 15:31
 */
public class RoundInput extends JComponent {
    private JPanel root_panel;
    private JTextField input;

    public RoundInput() {
        initPage();
    }

    private void initPage() {
        setLayout(new BorderLayout());
        add(root_panel, BorderLayout.CENTER);

        input.setBackground(AppConfig.getColor("main_background_color"));
        input.setForeground(AppConfig.getColor("main_font_color"));

        root_panel.setBackground(AppConfig.getColor("main_background_color"));

        Style.setBorder(1, input, root_panel);
        Style.setFont(1, input);
    }

    {
        // GUI initializer generated by IntelliJ IDEA GUI Designer
        // >>> IMPORTANT!! <<<
        // DO NOT EDIT OR ADD ANY CODE HERE!
        $$$setupUI$$$();
    }

    /**
     * Method generated by IntelliJ IDEA GUI Designer
     * >>> IMPORTANT!! <<<
     * DO NOT edit this method OR call it in your code!
     *
     * @noinspection ALL
     */
    private void $$$setupUI$$$() {
        root_panel = new JPanel();
        root_panel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
        root_panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), null, TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null));
        input = new JTextField();
        input.setHorizontalAlignment(0);
        root_panel.add(input, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, new Dimension(80, -1), null, null, 0, false));
    }

    /** @noinspection ALL */
    public JComponent $$$getRootComponent$$$() {
        return root_panel;
    }

}
